web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Updating record in Sal...
Power Automate
Unanswered

Updating record in Salesforce with multi-select picklist

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I am having an issue when updating a record using the Salesforce connector. The issue only happens when I try to update a field in the record that has multi-select picklist:

 

brands.JPG

 

When I try to update this field, the request receives the below error:

 

 

{
 "status": 400,
 "message": "A value must be provided for item.\r\nclientRequestId: 99098cd0-2514-426d-978c-****",
 "source": "salesforce-*****"
}

 

 

On the other hand, when I try to update the same record without referring to any of the picklist fields I receive a successfull response with all record fields, looking carefully at the picklist fields I notice that they have a "@odata.type" definition:

 

 

{
 "@odata.context": "https://sales*****.net/v2/$metadata#datasets('default')/tables('Contact')/items/$entity",
 "@odata.etag": "",
 "ItemInternalId": "1e76702a-fa17-48ab-9fa1-*****",
 "Id": "003570000****M",
****** MULTIPLE OTHER FIELDS ******
 "Last_Checked_By__c": null,
 "Extension_Number__c": null,
 "Liner_Brands__c@odata.type": "#Collection(String)",
 "Liner_Brands__c": [
 "Se****"
 ],
 "Decision_Maker__c@odata.type": "#Collection(String)",
 "Decision_Maker__c": [],
 "Contact_Type__c@odata.type": "#Collection(String)",
 "Contact_Type__c": [
 "Commercial"
 ],
 "External_ID__c": "BR0****1705",
 "First_Name_English__c": "Leandro",
 "Last_Name_English__c": "Paozinho",
 "Team_Contact__c": "No"
}

 

 

When I tried to use the update by EXTERNAL Id action I received a more detailed explanation:

 

 

 

{
 "error": {
 "code": 502,
 "source": "flow-*****m.net",
 "clientRequestId": "a5f83d7d-e714-4ace-b788-*****",
 "message": "BadGateway",
 "innerError": {
 "status": 502,
 "message": "Salesforce failed to complete task: Message: Cannot deserialize instance of multipicklist from START_ARRAY value [line:1, column:23]\r\nclientRequestId: a5f83d7d-e714-4ace-b788-******", "source": "Salesforce.Common",
 "errors": []
 }
 }
}

 

 

Hence the question is: How can I adapt my body to define the data type on it?

 

Current body generated from update record (not working):

 

{
"Field1": ["str1", "str2"]
}

 

 

Return from server (When not referring to the Field1 nor Field2):

[
 "Field1@odata.type": "#Collection(String)",
 "Field1": ["str1", "str2"],
  "Field2@odata.type": "#Collection(String)",
"Field2": ["str1", "str2"], ]

Any suggestion/comment is much appreciated!

 

Jean Phelippe

 

 

----------------------------

Quick Update:
I saw something workable for Sharepoint here: https://veenstra.me.uk/2018/04/18/microsoft-flow-create-sharepoint-list-item-and-get-a-badrequest/

But not sure how to adapt my Salesforce flow to incorporate this content definition. My knowledge on Odata is very limited. Appreciate any tips 🙂

Categories:
I have the same question (0)
  • Verified answer
    MichaelMS Profile Picture
    24 on at

    I'm assuming that you have a salesforce multi-select pick list  and that you want flow to choose some values from it.

     

    For example, multi-select picklist has allowable values of A, B, C, D. If you wanted to choose A and D. You need to have your data formatted as 

    A;D

    When updating the salesforce record, flow presents the field as an array where you can add elements. Something like this

    Screen Shot 2019-09-23 at 1.12.15 am.png

    You need to select Switch to entire array by clicking on the T symbol to the right of the field

    Screen Shot 2019-09-23 at 1.13.57 am.png

    This will change the field to accept the whole array at once. 

     

    Now you can put the values A;D that you have into this field.

    One warning, this won't work if you are using a string variable. Flow won't allow a string type to be stored in an array field. Instead store your string in a compose action. You can then assign the output from the compose to the array field.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard