cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sachinbansal
Microsoft
Microsoft

PowerApp - Patch Error - CDS Connector - Gov Cloud

Hi Experts

 

I am getting below error while using Patch for one of our custom entity “Participant Health History”. Inside Patch I am just setting Lookup value for Participant attribute which is contact entity. Attached is error snapshot.

 

Patch('Participant Health Histories', Defaults('Participant Health Histories'), {Participant: LookUp(Participants, Contact=currentParticipant.contactid)})

 

Error - "The Role column in the data source  you are updating expects a 'OptionSetValue' type and you are using a 'OptionSetValue' type"

 

This error comes only when app is opened in edit mode for first time. If cut/paste this formula and reload app, it works fine.

Any pointers will be appreciated.

3 REPLIES 3
v-siky-msft
Community Support
Community Support

Hi @Sachinbansal ,

 

To better understand your issue:

1. Do you meam the lookup Field column name is "Participant", and it looks up form Contact entity, right?

2. What is currentParticipant?

 

Maybe you made a mistake about the lookup entity, please try with the following formuals.

Patch('Participant Health Histories', Defaults('Participant Health Histories'), {Participant: LookUp(Contacts, Contact=currentParticipant.contactid)})

Best regards,

Sik

 

Hi @v-siky-msft 

Yes, to answer your first question.

currentParticipant is variable which holds data for selected participant from first screen.

 

"Participant" is display name for "Contact" entity only. So when you add contact as data source it appears as "Participants" only and same is being used in my Lookup formula.

Any updates?

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (5,186)