Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

Dropdown option Set with mapping

(0) ShareShare
ReportReport
Posted on by 190
Hi
 
I built a demo to test it myself before implementing it in another app.
 
I have a Department and Section in SharePoint. The Department is a single line of text, while the Section is more like choices.
 
 
As you can see, the Section choice ranges from A1 to A15, and it allows users to add values manually. 
I have built a PowerApp using both classic and modern approaches. For the Department field, I changed it from a single line of text to a dropdown menu using a JSON method, and the Section field is set as a choice.
 
 
Clear(deptCollection);
Clear(sectionMapping);

 

ClearCollect(
    deptCollection,
    [
        "Architects",
        "Community and Cultural Development",
        "Corporate Services",
        "Finance & Water Services",
        "Forward Planning Infrastructure",
        "Infrastructure & Climate Change",
        "Planning"
    ]
);

 

ClearCollect(sectionMapping,
  {Department: "Architects", Section: "a1"},
  {Department: "Architects", Section: "a3"},
  {Department: "Architects", Section: "a4"},
  {Department: "Community and Cultural Development", Section: "a2"},
  {Department: "Community and Cultural Development", Section: "a5"},
  {Department: "Corporate Services", Section: "a6"},
  {Department: "Corporate Services", Section: "a7"},
  {Department: "Corporate Services", Section: "a8"},
  {Department: "Finance & Water Services", Section: "a9"},
  {Department: "Finance & Water Services", Section: "a11"},
  {Department: "Forward Planning Infrastructure", Section: "a12"},
  {Department: "Infrastructure & Climate Change", Section: "a14"},
  {Department: "Planning", Section: "a15"}
);
 
Department change to choice on item name 
 
deptCollection
 
 
Section, I has to change choice into filter 
 
Filter(sectionMapping, Department = DataCardValue2.Selected.Value).Section
 
Updated the correct section 
DataCardValue6.Selected
 
 
When I click the button to save it into SharePoint, I can only save the Department but not the Section.
 
 
 
I have tried many different methods, including using Copilot, but I haven’t had any success.
 
ClearCollect(sectionMapping,
    {Department: "Architects", Section: Choices([@'Department and Section'].'Section')},
    {Department: "Community and Cultural Development", Section: Choices([@'Department and Section'].'Section')},
    {Department: "Corporate Services", Section: Choices([@'Department and Section'].'Section')},
    {Department: "Finance & Water Services", Section: Choices([@'Department and Section'].'Section')},
    {Department: "Forward Planning Infrastructure", Section: Choices([@'Department and Section'].'Section')},
    {Department: "Infrastructure & Climate Change", Section: Choices([@'Department and Section'].'Section')},
    {Department: "Planning", Section: Choices([@'Department and Section'].'Section')}
);

 
 
 
I don't want this section changed to a single line of text, as it works on the department; I want to stay with the choice.
 
any suggest or advice would be great
  • stevenpetersmi Profile Picture
    stevenpetersmi 190 on at
    Dropdown option Set with mapping
    Hi Ytalo Silva
     
    Thank you for your reply. However, your suggestion is not working at all. It seems I have no choice but to reach out to Microsoft support, as I am experiencing issues with SharePoint and Dataverse as well.

    I believe the problem is not related to PowerApps but rather pertains to the Choice field. It is not updating correctly with the mapping relationship.

    Even though I am able to pull data, as shown below:
     
       {Department: "Architects", Section: LookUp(Choices('Section (Department & Sections)'), Value ="a1").Value},
     
    The code isn't working because the value "a1" is neither a type nor a variable.
    { Department: "Architects", Section: 'Section (Department & Sections)'.a1 }
    This last one, A1, pulls data from Choice in SharePoint, but it ends with an error stating "Error Loading Control."
     
     
    even last one 
     
    {Department: "Architects", Section: LookUp(Choices('Section (Department & Sections)'.a1), Text(Value) = "a1")}
     
    It still failed. I hope that Microsoft will get back to me. I also hope there is no bug, as my last two calls to Microsoft were related to a Microsoft bug or not in scope.
     
  • Suggested answer
    Ytalo Silva Profile Picture
    Ytalo Silva 63 on at
    Dropdown option Set with mapping

    Hello, try putting the update in this format.


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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,567

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard