I have a custom object X that stores name value pairs. I need to populate a custom object Y which has field names same as the name part of the value. Through visual flow I need to query object X to fetch all name value pair that needs to be moved to object Y. All name value pair in object X are related to through a unqiueID.
So, my thoughts are to fast lookup object X for all records that have the uniqueID. The idea is to gather the results in an Sobject collection. The second part is to do the assignment by viewing the name part of the pair and assigning it's value part to field in object Y.
Please provide suggestions to say if this is the right approach. I am just concerned about three things:
- How would the system know how many object X records it has to fetch
- Do I need to use a loop to keep searching? I suppose if the results are populated in sObject collection then looping is not required.
- The third challenge is assignment i.e. chec if
X.name = "abc..."then
I think this would require looping for traversing through the sObject collection to populate all of the object Y field.