cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Radoslavov
Continued Contributor
Continued Contributor

Unknow error when trying to update SPO list record

Hi all,

 

i have power apps that is used to enter new onboarding requests by HR.

The logic is the following:

 

When a new request is created by the HR, the supervisor of the new hire employee received new record that he needs to approve (such as equipment's, accounts, etc.). The supervisor click on edit and he is redirected to a new screen with two forms:

Radoslavov_0-1636973877184.png

Left side has a view form with details already input by the HR, and the right site has a edit form where he have to fill the rest of the information.

Radoslavov_1-1636974013298.png

Upon submit, the SPO list record should be updated with the remaining information from the supervisor, the problem is after submit, a get an error message "Unknow error has occur" and nothing more. The record is not updated, and I don't see the error before I press Submit, meaning that the formula seems to be ok.

 

Patch(
    'Onboarding Requests',MyRequestsGallerySupervisor.Selected,
    {
        'Reference User': ChoiceReferenceUser,
        'Required Accounts': DDRequiredAccount,
        'IT Equipment ': DDITEquipment,
        'SAP Account': DDSAPAccount,
        'I Accept costs of new equipment': DDAcceptTerms
    }
);
ResetForm(NewRequestPhase2Form)

Radoslavov_2-1636974196771.png

I don't know if it's worth to mention that most of the options for the supervisor are multiple choice SPO fields as the user will need more than one account, and more than one piece of equipment.

Radoslavov_3-1636974290085.png

Any help is appreciated if you know what I'm missing or doing wrong.

 

Regards

Kiril

1 ACCEPTED SOLUTION

Accepted Solutions
Radoslavov
Continued Contributor
Continued Contributor

Found the problem and i feel so stupid.

I forgot to add the the each property's item (Selected, SelectedItems, etc.) 

    {
        'Reference User': ChoiceReferenceUser.Selected,
        'Required Accounts': DDRequiredAccount.SelectedItems,
        'IT Equipment ': DDITEquipment.SelectedItems,
        'SAP Account': DDSAPAccount.SelectedItems,
        'I Accept costs of new equipment': DDAcceptTerms.Selected
    }

 Thanks you @rampprakash for looking into this anyway 🙂 

 

Appreciate your time!

 

Stay safe all and Regards

Kiril

View solution in original post

5 REPLIES 5
rampprakash
Super User
Super User

Hello @Radoslavov 

 

While using Choice Reference please try using like below

 

Patch('Sharepoint List Name',

   Defaults('Sharepoint List Name'),

{choice:

 {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",

   Id:1,

  Value:"Enter Choice #2"} // Approved

 }

)

 

Please mark as Answer if it is helpful and provide Kudos


Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com

Radoslavov
Continued Contributor
Continued Contributor

Hi @rampprakash I'm not sure i follow you proposal, I'm bit confused 

This is my formula I'm currently using , so I don't know where this has to fit, for which option and etc.

 

Patch(
    'Onboarding Requests',MyRequestsGallerySupervisor.Selected,
    {
        'Reference User': ChoiceReferenceUser,
        'Required Accounts': DDRequiredAccount,
        'IT Equipment ': DDITEquipment,
        'SAP Account': DDSAPAccount,
        'I Accept costs of new equipment': DDAcceptTerms
    }
);
ResetForm(NewRequestPhase2Form)

 

Regards

Kiril

 

Hello @Radoslavov,

 

Can you please confirm what is the field type in SharePoint list for 'Reference User', Required Accounts.

 

Is there any Lookup or choice field used?

 

Please mark as Answer if it is helpful and provide Kudos


Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
Blog : https://microsoftcrmtechie.blogspot.com

 

Radoslavov
Continued Contributor
Continued Contributor

Here are all the filed types

 

Radoslavov_0-1636978469399.png

 

Radoslavov
Continued Contributor
Continued Contributor

Found the problem and i feel so stupid.

I forgot to add the the each property's item (Selected, SelectedItems, etc.) 

    {
        'Reference User': ChoiceReferenceUser.Selected,
        'Required Accounts': DDRequiredAccount.SelectedItems,
        'IT Equipment ': DDITEquipment.SelectedItems,
        'SAP Account': DDSAPAccount.SelectedItems,
        'I Accept costs of new equipment': DDAcceptTerms.Selected
    }

 Thanks you @rampprakash for looking into this anyway 🙂 

 

Appreciate your time!

 

Stay safe all and Regards

Kiril

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (4,175)