0

I have a pretty simple scenario but I'm not sure it will work. I created a custom metadata type for assessment questions sales reps have to do on lead.

Each question has a preferred answer (e.g. it should be "Yes").

I made a screen element w/ several radio components that all use "Yes" and "No" choices.

My hope was I could pull all assessment questions in to collection variable (this part seems to work) and then reference as the Label of each radio button component, e.g. {!QuestionRecordSet[0].Question__c}

Also, I'd later want to compare the screen component choice (e.g. "Yes" or "No") with the record preferred answer in the same way.

Is this possible? If so, how? Is there a better way to do what I'm trying to do? This is currently done with custom objects and apex but we don't need to store any of this data, only a text area with the question and the sales reps answer.

  • each radio button needs to reference a separate record variable (i.e. separate MDT record) as there is no support for indexing collection variables in V46. Fortunately, each MDT query does not burn soql limit – cropredy Sep 30 '19 at 17:50
  • Okay, so just to clarify, you're saying I can't use record collection variables? If so, how would I store each MDT record in a separate variable? Thanks – jameskbw Sep 30 '19 at 18:01
  • you can't index a collection variable in an expression - so either do one collection variable and then loop therein assigning each loop elm to a separate record variable -- or -- do n individual Get Record into specific record variables – cropredy Sep 30 '19 at 18:05
  • Okay, thank you for clarifying. – jameskbw Sep 30 '19 at 18:15
0

Because (as of V46) you can't index record collection variables, you have two options

Precondition:

  • Each radio button is bound to a singleton recordVariable, perhaps named questionX, questionY, ... Thus, you have n recordvariables

Option1:

  • Query all the MDT into a record collection variable and then loop through them
  • Use decision elements to assign the MDT to one of the questionN record variable based on the developername of the MDT

Option2:

Have a sequential series of Get Record elements, each querying a different MDT (using the developername) and assigning to the relevant questionN record variable

Fortunately, MDT queries don't count against your SOQL limits

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.