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 / Help with Sharepoint, ...
Power Apps
Answered

Help with Sharepoint, data source, and Patch

(0) ShareShare
ReportReport
Posted on by 22

Hi

I’m new to PowerApps and I’m still learning.

I have a form to add new items to Sharepoint, FDM Request Form.

 

I created a column named Cost_Center  and used Choice for a drop down. I used another data source ('FDM Cost Centers' SharePoint) to populate the dropdown.

Items : 'FDM Cost Centers'.FDM_CostCenter

 

I tried a Patch Function to add the new items with the selected cost center but, I kept getting an error regarding Record, Text, and Data type. Watching tutorials and searching this forum, gave me lots of possible answers, but I also got really confused. So, I ended up creating the other columns, CostCenterNum and CostCenterText. Please see attached images. 

 

I even deleted the DataCardValue and replaced it with a ComboBox. (SelectMultiple: False, I only need one selection)

 

Update: Patch('FDM Request Form', Defaults('FDM Request Form'), {Cost_Center: ComboBox1.Selected.Value})

 

  • What is the correct way to Patch the cost center to FDM Request Form SP?
  • I would prefer the cost center without commas. eg 1001293790
  • Also, in New and Edit mode, I see all the possible cost center from the FDM Cost Center SP list, but when I use the details pane or the quick edit mode, my ComboBox only have the original default selection from drop down. The other two columns (CostCenterText and CostCenterNum) are regular input fields. Is there a fix for this?
 

Any feedback or suggestion would greatly be appreciated. 

 

Thank you

 

 

 

 

DetailsPanel.jpg
Columns.JPG
Categories:
  • WarrenBelz Profile Picture
    156,926 Most Valuable Professional on at

    Hi @kamekie ,

    Try this - I assume you are running this off a button or icon

    Patch(
     'FDM Request Form', 
     Defaults('FDM Request Form'), 
     {
     Cost_Center: 
     {Value:ComboBox1.Selected.Value}
     }
    )

     

    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.

  • kamekie Profile Picture
    22 on at

    Hi Warren, 

     

    Thank you for your quick response. 

    I'm creating a new item through SharePoint. 

     

    I'm still getting an error of invalid type. Expecting Record value, but of a different schema.

    Incompatible type. The 'value' column in the data source you're updating expects a 'text' type and you're using a 'error' type. 

     

    Please see attach image for error. 

     

     
     

     

    error02.JPG
  • WarrenBelz Profile Picture
    156,926 Most Valuable Professional on at

    Hi @kamekie ,

    You mentioned a Choice column, hence the Value reference. If it is Text, then you need

    Patch(
     'FDM Request Form', 
     Defaults('FDM Request Form'), 
     {Cost_Center:ComboBox1.Selected.Value}
    )

     

    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.

  • kamekie Profile Picture
    22 on at

     

    Hi Warren,

     

    Both suggestions are not working for me.

     

    What other properties should I be double checking?

     

     

    costcenterText.pngcostcenterChoice.pngColumns.JPGitemsProperty.png

  • WarrenBelz Profile Picture
    156,926 Most Valuable Professional on at

    Hi @kamekie ,

    Can you please show me your SharePoint field definition for Cost_Centre? This solution should not be difficult.

  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @kamekie ,

     

    The problem is in Update property, there is no need to apply the Patch function in Update property, the update property only requires the value of the column that need to be submitted.

     

    If you save the form values by SubmitForm() function, please modify the Update property of Cost_Center DataCard as follows.

    {Value: ComboBox1.Selected.Value}

    Or

    {Value: ComboBox1.Selected.'FDM_CostCenter'}

     

    Since the Cost_Center field is the Choices fields, the premise of success is that the all FDM_CostCenter column values must be in the choices options when you define the column.

    Snipaste_2020-06-10_09-53-13.png

    Hope this helps,

    Sik

  • kamekie Profile Picture
    22 on at

     

    Please see attached images. 

     

    SP_CostCenter.JPGcostcenter_DataCard.JPGcombobox.JPGfdm_costcenter.JPG

  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @kamekie ,

    So there are two solution.

    1, add all FDM_CostCenter column values into the choices options, and modify the Update property to

    {Value: ComboBox1.Selected.'FDM_CostCenter'}

     

    2, Change the Cost_Center column to Single line of text type, then modify the the Update property to 

    ComboBox1.Selected.'FDM_CostCenter'

     

    Both solutions should work for your case.

    Hope this helps.

    Sik

  • kamekie Profile Picture
    22 on at

    Hi Sik,

     

    Your first solution {Value: ComboBox1.Selected.'FDM_CostCenter'} works.

     

    However, when I go to edit mode or open (for view mode). The selected value is blank. If i cancel, I still see it. 

     

     

    onEdit.JPG  onEdit2.JPG

  • Verified answer
    WarrenBelz Profile Picture
    156,926 Most Valuable Professional on at

    @v-siky-msft ,

    I would appreciate being given a little time to respond to an answer to my question.

    @kamekie , your post of the image I asked for has provided the source of the problem - you do not need to Patch in the Update of a card. I am happy to continue with your issue if you need me - just tag me in your response.

     

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 Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard