Hi everyone.
So I want to take a picture with the camera, select a field in CDS from a dropdown and then patch that selected field.
I have a dropdown with say Items: ['field_a', 'field_b', 'field_c'] (referencing an entity in CDS)
Now, I could use multiple nested if statements for the Patch function:
If (Dropdown1.Selected.Value = 'field_a')
Patch(EntityName, Gallery1.Selected, {'field_a': photoVariable}), and so on
But there has to be a better way, no!?
I have tried multiple things without any success, get errors for all of them:
Patch(EntityName, Gallery1.Selected, {Dropdown1.Selected.Value: photoVariable})
Patch(EntityName, Gallery1.Selected, {'Dropdown1.TextValue': photoVariable}) and so on
Another thought was to reference the fields in the dropdown in another way, but no success there either.
Do you have any ideas of how I can get rid of all the If statements?
Thanks.