cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kipetcoff
Level: Powered On

Dynamics 365 Look up field update

Hi, All.

I don't know how to set up Look Up field in my Power Apps edit form.

In all samples that I found was possibility to change feild type to Look Up, but in my case I have 2 fields with the same name and different kind of input control. 1 Label and 2 is Look up.

Label is something strange with "?" type.

Base on Lookup Field I set Items to

ShowColumns(Проекты;"awr_name";"awr_projectid")


and Update of DataCard to

LookUp(Проекты;Проект=DataCardValue28.Selected.awr_projectid;'Проект (awr_project)') 


and it doesn't work.

 

How to set up it properly? I there any instructions how to set up actions for Dynamics 365?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Dynamics 365 Look up field update

Hi @Kipetcoff,

Could you please share more details about the error message within your app?

Could you please share a bit more about the data type of the Проект column your LookUp control related to? Is it a LookUp type column?

Could you please share a bit more about the Проекты data source within your LookUp formula? Is it the data source your Проект column references values from?

I think there may have something wrong with the LookUp formula within the Update proeprty of the Проект Data card. If the Проект is a LookUp column in your Entity, the Update proeprty of the Проект Data card is required to provide a record value rather than a text value (your LookUp formula returned).

Please take a try to modify your formula within the Update property of Проект Data card into following:

LookUp(Проекты; Проект = DataCardValue28.Selected.awr_projectid)

In addition, I have also made a test on my side, the SubmitForm function may not submit your form data into your Entity successfully. Currently, as an alternative solution, please take a try to submit your form data into your Entity using Patch function.

I have made a test on my side, please take a try with the following workaround:3.JPG

 

4.JPG

Please disable the "Use column display names" option and "Use GUID data types of instead of strings" option within Advanced settings of App settings of your app firstly. Then save your app and re-load it.

Set the OnSelect property of the "Patch" button to following:

Patch(
    Employees, 
    Defaults(Employees),
    {
        new_name: DataCardValue13.Text, 
        _new_account_value: DataCardValue16.Selected.accountid
    }
)

Note: The new_account represents the display name of the LookUp column in my Entity. 

On your side, you should type:

Patch(
    YourEntity, 
    Defaults(YourEntity),
    {
        column1: DataCardValue1.Text, 
column2: DataCardValue2.Text,
... _YourLookUpColumn_value: LookUp(Проекты; Проект = DataCardValue28.Selected.awr_projectid; 'Проект (awr_project)'),
... } )

Note: I assume the 'Проект (awr_project)' represents the Primary Key column in your Проекты data source, and the Проекты data source is Entity which your LookUp column (Проект) references value from.

 

 

 

Please check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Not-able-to-create-the-attachment-regarding-a...

https://powerusers.microsoft.com/t5/Common-Data-Service-for-Apps/Ambiguous-binding-present-on-Patch/...

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Kipetcoff
Level: Powered On

Re: Dynamics 365 Look up field update

Hi @v-xida-msft.

Finally I used Update method as it described here but change Items method.

But anyway thank you for advanced settings of "Use GUID data types instead of strings" after it was done some fields have new behavior.

So in my case

Items

ShowColumns(Проекты;"awr_name";"awr_projectid")

Default

LookUp(Проекты;awr_projectid=Parent.Default;awr_name)

Update

DataCardValue5.Selected.awr_projectid

And it works for me

 

4 REPLIES 4
Community Support Team
Community Support Team

Re: Dynamics 365 Look up field update

Hi @Kipetcoff,

Could you please share more details about the error message within your app?

Could you please share a bit more about the data type of the Проект column your LookUp control related to? Is it a LookUp type column?

Could you please share a bit more about the Проекты data source within your LookUp formula? Is it the data source your Проект column references values from?

I think there may have something wrong with the LookUp formula within the Update proeprty of the Проект Data card. If the Проект is a LookUp column in your Entity, the Update proeprty of the Проект Data card is required to provide a record value rather than a text value (your LookUp formula returned).

Please take a try to modify your formula within the Update property of Проект Data card into following:

LookUp(Проекты; Проект = DataCardValue28.Selected.awr_projectid)

In addition, I have also made a test on my side, the SubmitForm function may not submit your form data into your Entity successfully. Currently, as an alternative solution, please take a try to submit your form data into your Entity using Patch function.

I have made a test on my side, please take a try with the following workaround:3.JPG

 

4.JPG

Please disable the "Use column display names" option and "Use GUID data types of instead of strings" option within Advanced settings of App settings of your app firstly. Then save your app and re-load it.

Set the OnSelect property of the "Patch" button to following:

Patch(
    Employees, 
    Defaults(Employees),
    {
        new_name: DataCardValue13.Text, 
        _new_account_value: DataCardValue16.Selected.accountid
    }
)

Note: The new_account represents the display name of the LookUp column in my Entity. 

On your side, you should type:

Patch(
    YourEntity, 
    Defaults(YourEntity),
    {
        column1: DataCardValue1.Text, 
column2: DataCardValue2.Text,
... _YourLookUpColumn_value: LookUp(Проекты; Проект = DataCardValue28.Selected.awr_projectid; 'Проект (awr_project)'),
... } )

Note: I assume the 'Проект (awr_project)' represents the Primary Key column in your Проекты data source, and the Проекты data source is Entity which your LookUp column (Проект) references value from.

 

 

 

Please check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Not-able-to-create-the-attachment-regarding-a...

https://powerusers.microsoft.com/t5/Common-Data-Service-for-Apps/Ambiguous-binding-present-on-Patch/...

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Kipetcoff
Level: Powered On

Re: Dynamics 365 Look up field update

Hello,

Thank you for response.

Проект is CRM LookUp field

This code doesn't work

LookUp(Проекты; Проект = DataCardValue28.Selected.awr_projectid)

I will try Patch method.

Thank you.

Community Support Team
Community Support Team

Re: Dynamics 365 Look up field update

Hi @Kipetcoff,

Have you taken a try with Patch function on your side?

Have you solved your problem?

If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Kipetcoff
Level: Powered On

Re: Dynamics 365 Look up field update

Hi @v-xida-msft.

Finally I used Update method as it described here but change Items method.

But anyway thank you for advanced settings of "Use GUID data types instead of strings" after it was done some fields have new behavior.

So in my case

Items

ShowColumns(Проекты;"awr_name";"awr_projectid")

Default

LookUp(Проекты;awr_projectid=Parent.Default;awr_name)

Update

DataCardValue5.Selected.awr_projectid

And it works for me

 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 133 members 4,446 guests
Please welcome our newest community members: