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 Apps / Save dropdown selected...
Power Apps
Answered

Save dropdown selected item to sharepoint list item

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have a sharepoint list called "Varer" with a column "Varenavn" set to single line of text.

Then I have another sharepoint list called "Bestillinger" with a column "Vare" set to single line of text. In my list "Bestillinger" i want to add new items to the list with choices coming from the "Varer" list and the "Varenavn" column. Also i want to write a status field value when the form is submitted. In powerapps I have customized the new item form for the "Bestillinger" list. I have added a custom dropdown control and set its Elements to "Varer" and Value to "Varenavn". This works. When running the form it shows the items from the "Varer" list in the dropdown. But I cannot figure out how to make the selected value from the dropdown get saved to the list "Bestillinger" when the form is submitted. I tried to use the Patch function on the "OnSave" event. But cant find the right syntax:

 

If(
SharePointForm1.Mode = New,
Patch(
Bestillinger,
{ID: Blank()},
SharePointForm1.Updates,
{ Status: "1 - Forespørgsel"()}
Vare: {
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
Value:VareDropdown1.Selected.Value
}
)
),
SubmitForm(SharePointForm1)
)

 

Error2.png
Error1.png
Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    Modify the first part of the formula to (FormMode.New):

    If(
    SharePointForm1.Mode = FormMode.New,

    Patch(
    Bestillinger,
    {ID: Blank()},
    SharePointForm1.Updates,
    { Status: "1 - Forespørgsel"()}
    Vare: {
    '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
    Value:VareDropdown1.Selected.Value
    }
    )
    ),
    SubmitForm(SharePointForm1)
    )

     

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

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Unfortunately its still the same.

    It still doesn't seem to like the starting parenthesis If(

    And still also the comma after FormMode.New

     

    So nothing happens when pressing the save button

     

    If(
    SharePointForm1.Mode = FormMode.New,
    Patch(
    Bestillinger,
    {ID: Blank()},
    SharePointForm1.Updates,
    { Status: "1 - Forespørgsel"()}
    Vare: {
    '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
    Value:VareDropdown1.Selected.Value
    }
    )
    ),
    SubmitForm(SharePointForm1)
    )

     

    Error3.png
  • WarrenBelz Profile Picture
    155,565 Most Valuable Professional on at

    Hi @Anonymous 

    Try this

    If(
     SharePointForm1.Mode = FormMode.New,
     Patch(
     Bestillinger,
     Defaults(Bestillinger),
     {
     ID: Blank(),
     Status: "1 - Forespørgsel",
     Vare: {
     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Value:VareDropdown1.Selected.Value
     }
     }
     ),
     SubmitForm(SharePointForm1)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Warren,

    Thanks for the reply.

    There's still something wrong, look at the underscores. Im all new to this PowerApps so maybe im doing something completely wrong.

    ErrorP.png

  • WarrenBelz Profile Picture
    155,565 Most Valuable Professional on at

    Hi @Anonymous, 

    Something very strange here - I put the same code syntax in the OnSave of an SP integrated form and it accepted it fine.

    What world region are you in - do you need this?

    If(
     SharePointForm1.Mode = FormMode.New;
     Patch(
     Bestillinger;
     Defaults(Bestillinger);
     {
     ID: Blank();
     Status: "1 - Forespørgsel";
     Vare: {
     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
     Value:VareDropdown1.Selected.Value
     }
     }
     );
     SubmitForm(SharePointForm1)
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks again for helping.

    I am in Denmark, northern europe.

    Tried your code, it gets a little further now:

    Errorq.png

  • KrishnaV Profile Picture
    5,023 on at

    hi @Anonymous,

     

    Please try this code and let us know:

    If(
     SharePointForm1.Mode = New,
     Patch(
     Bestillinger,
     Defaults(Bestillinger),
     {
     ID: Blank(),
     Status: {
     Value: "1 - Forespørgsel",
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
     }
     }
     ),
     SubmitForm(SharePointForm1)
    )

    I have validated and it is working fine and saving values as expected.

     

    I hope this resolved your issue if you see any challenge/need further help let me know I am always happy to help.

    Regards,
    Krishna
    If this post helps give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • WarrenBelz Profile Picture
    155,565 Most Valuable Professional on at

    Hi @Anonymous ,

    I am in Australia (hence only answering now).

    What type of field is Vare?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hi @KrishnaV 

    Unfortunately, that did not help.

    Back to the first problem again with the first "(" and the first ","

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz 

    -Alright thats all fine, glad you want to help anyway.

    Vare is single line of text column

     

    Vare.png

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 387

#2
timl Profile Picture

timl 340 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 301

Last 30 days Overall leaderboard