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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to set the Country...
Power Automate
Unanswered

How to set the Country Field in Dynamics for Sales from a Power Automate Flow

(0) ShareShare
ReportReport
Posted on by 69

Hello, 

When a Folder is created in my Sharepoint Document Library File, a flow is triggered that creates a new Lead in Dynamics.

All is working well but my issue is how can I set the Country Field (Choice) to be the Name of the created Folder?

The Folder's name is the Country name, but the problem is I think the Country labels/names internally are related to integers.

 

Thank you in advance for any help provided.

1) Check if the folder created in SharePoint is in the right directory1) Check if the folder created in SharePoint is in the right directory

 

2) If the folder is created in the correct directory, Create New record in Dataverse2) If the folder is created in the correct directory, Create New record in Dataverse

 

3) Set Country (Dropdown) to be the name of the file (result of Compose)3) Set Country (Dropdown) to be the name of the file (result of Compose)

 

Categories:
  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @Joseph_Nasr ,

    I don't remember to have a Country Field (Choice) - native general choice in Dataverse (including Dynamics 365 - Sales solution), so I suppose that it is a custom general choice. Also I suppose that the country name is correctly obtained as outputs of Country compose action. 

     

    What we need to obtain before creating a new row is the choice value of the country you want to write and this can be done (as far as I know) using a HTTP with Azure AD -> Invoke an HTTP request action.

     

    gabibalaban_0-1666704166413.png

    where the url of the request is:

     

    https://YourDynamicsDomain/api/data/v9.1/GlobalOptionSetDefinitions(Name='YourCountryChoiceInternalName')

     

    This action will return as outputs all choices of YourCountryChoiceInternalName including Value and label name (Country name) in your case.

    After that all you need to do is to filter the outputs based on country value obtained on compose Country action. 

    gabibalaban_1-1666704631211.png

     

     where:

    From -> 

     

    outputs('Invoke_a_HTTP_request')?['body/Options']

     

    and 

     

    equals(item()?['Label/LocalizedLabels'][0]['Label'], outputs('Country'))

     

    Hope it clarify your problem !

  • Joseph Nasr Profile Picture
    69 on at

    I think your solution is what will work. However I just wanted to ask about: 

     

    http.PNG

     

    I got a bit confused as to what to fill those fields

     - My dynamics base URL: https://something.crm.dynamics.com/

     - My SP URL: https://something.sharepoint.com/

  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @Joseph_Nasr ,

    In both:

    https://something.crm.dynamics.com/

    It should be enough.

  • Joseph Nasr Profile Picture
    69 on at

    Thank you! one thing though is that the Filter doesn't work as Filter Array should take an array in the "From" field while the output of the HTTP request is giving an 'object'

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 331 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard