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

Simply Checkbox that add data from entity1 to entity2

checkexample.PNG

 

Is there any simple code that when I check on any box then ML101-1 is automatically added to the editform cardvalue?

 

Thanks in advance!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Simply Checkbox that add data from entity1 to entity2

Hi @tofsweden,

OK.

Under the Multi-line TextInput DataCard of Entity, choose to unlock, then add a gallery with items property configured with Entity2.

Then switch the Entity 2 gallery record control (mostly here should be Label control ) into CheckBox control, keep only the CheckBox control, and switch the Value to the proper field, when this is done, the field value (in your scenario should be  ML101 field ) would be shown under CheckBox.Text.

After that, configure the CheckBox within Entity 2 Gallery OnCheck and OnUnCheck property.

OnCheck

 

Collect(DataUse,Table({Value:Checkbox.Text&Char(13) & Char(10)}))

 

OnUnCheck

Remove(DataUse,{Value:Checkbox.Text&Char(13) & Char(10)})

DataUse is a collection created to store the selected value, it is neither entity1 nor entity2.

 table({Value:CheckBox.Text&Char(13)&Char(10)})

As explained above, Checkbox.text should be the field value, here we combine this value with Char(13) and Char(10), which is used to carriage return (CR) and Line Feed (LF).

In order to display multi-selection into a Multi-line Text Inputbox, here we use the 

Concat(DataUse,Value)

Under the Default property of the Multi-Line TextInput for Entity 1.

Concat () function would combine all value from the selected column in a table into One string, in order to make it display in seperate line, Char(13) and Char(10) are used as the Value part.

Post back if you have any further questions.

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

11 REPLIES 11
tofsweden
Level: Powered On

Re: Simply Checkbox that add data from entity1 to entity2

Anyone? It's amazing that there's no support for this from what I've seen. There is a complex blog about this however it is supported only by sharepoint as database behaviour are different from each other.

Ancherl
Level: Powered On

Re: Simply Checkbox that add data from entity1 to entity2

Hi,@tofsweden

According to your statement, I guess that if you check on ML101-1 box then ML101-1 is automatically added to the editform cardvalue and if you check on ML101-2 box then ML101-2 is automatically added to the editform cardvalue, and so on. Is that true?

 

Regards,

Ancherl

tofsweden
Level: Powered On

Re: Simply Checkbox that add data from entity1 to entity2

Hi @Ancherl

 

That is true!

 

Regards

Ancherl
Level: Powered On

Re: Simply Checkbox that add data from entity1 to entity2

Hi,@tofsweden

I am very sorry for late answer, but I want to ask a question for solving this problem better. The part as follows is a gallery and it is connected to a data source. 1.PNG

 

 

 

Is that true?

 

Regards,

Ancherl

Ancherl
Level: Powered On

Re: Simply Checkbox that add data from entity1 to entity2

Hi,@tofsweden

If you check on ML101-1 box and ML101-2 box at the same time, ML101-1 and ML101-2 are both added to the editform cardvalue. Is that true? 

tofsweden
Level: Powered On

Re: Simply Checkbox that add data from entity1 to entity2

@Ancherl

 

ML101 belongs to a different entity (table) and is not connected to same datasource as the field where I want ML101 to be added.

 

In this screen, I have one detailform with datasource1 and one gallery (ML101) with datasource2.

 

So, to your answer it is true.

tofsweden
Level: Powered On

Re: Simply Checkbox that add data from entity1 to entity2

@Ancherl

 

Yes it is true, made possible by having the field datatype as multi-text!

 

Regards

Community Support Team
Community Support Team

Re: Simply Checkbox that add data from entity1 to entity2

Hi @tofsweden,

 

Please check to see if the following would meet your requirements:

1. Configure the CheckBox OnCheck Property with the code below:

Collect(DataUse,Table({Value:Checkbox.Text&Char(13) & Char(10)}))

2. Configure the CheckBox OnUnCheck Property with the code below:

Remove(DataUse,{Value:Checkbox.Text&Char(13) & Char(10)})

3. Configure the Default property of the MultLine TextInput with the code below:

Concat(DataUse,Value)

Step 1 configure the CheckBox OnCheck property to collect checkbox.text into a single column table with the column named Value, Char(13) and Char(10) is used to CRLF.

Step 2 configure the checkBox OnUnCheck property to remove the item added,

Step 3 is used to combine the selected data into one string, which then could be shown under the Multline InputBox.

 

If you have any further questions, please post back.

 

Regards,

Michael

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

Re: Simply Checkbox that add data from entity1 to entity2

hi @v-micsh-msft

 

Could you use entity1 and entity2 to differ, so I could understand where to put code and also how does it direct the text frfrom entity2 (with ML101) to be put into the targeted DataCardValue that belongs to entity1?

 

What is CRLF?

 

Thanks

 

 

Example:

 

Do you mean: 

Collect(Entity1,Table({Value:Checkbox.Text&Char(13) & Char(10)}))

What is Char(13) and Char(10)? Should I replace them with ML101 fieldname?

 

edit;

If you mean datacard, then it says that Collect(DataCard18 is not valid, it have to be a datasource

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,742)