Dear All,
I would like to create a collection where I store data from different Inputs (TextInput, Dropdown).
First, I created Variable tables for the Input elements, later I tried to collect them but it is not working but I followed the Microsoft offers from the Documentation page.
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-table-shaping
Set(
Business_owner,
Table(
{
Answer: Business_owner_TextInput.Text,
Comment: Business_owner_Comment_TextInput.Text
}
)
);
Set(
Related_Project_Dd,
Table(
{
Answer: Related_Project_Dropdown.Selected,
Comment: Related_Project_Comment_TextInput.Text
}
)
);
ClearCollect(
Detail_Table,
Table(
{ Answers: Business_owner.Answer, Comments: Business_owner.Comment },
{ Answers: Related_Project_Dd.Answer, Comments: Related_Project_Dd.Comment }
)
)
Thank you for your help in advance.
Solved! Go to Solution.
Thank you very much for your help.
The solution is similar what you suggested.
ClearCollect(
Detail_Table,
{ Answers: First(Business_owner).Answer, Comments: First(Business_owner).Comment },
{ Answers: First(Related_Project_Dd).Answer.SourceTableOfTheDropdown, Comments: First(Related_Project_Dd).Comment}
)
You have set your variables as a table. In your clearcollect formula, you grab the specified column of that variable, but it will still be a table. The fields in your collection will therefore be populated by a 1x1 table since there is only one row in your variable.
Set(
Business_owner,
Table(
{
Answer: Business_owner_TextInput.Text,
Comment: Business_owner_Comment_TextInput.Text
}
)
);
Set(
Related_Project_Dd,
Table(
{
Answer: Related_Project_Dropdown.Selected,
Comment: Related_Project_Comment_TextInput.Text
}
)
);
ClearCollect(
Detail_Table,
Table(
{ Answers: First(Business_owner).Answer, Comments: First(Business_owner).Comment },
{ Answers: First(Related_Project_Dd).Answer, Comments: First(Related_Project_Dd).Comment }
)
)
Here you specify that the first row of the table in your has to be grabbed, and that the specified column has to populate the relevant field in your collection.
Hello,
Thank you for your reply.
Unfortunately, it is still not working.
What is the items property of your dropdown? If that is a table as well, then you need to further specify which value to grab from it. If you add a . after
First(Related_Project_Dd).Answer
Do any suggestions come up?
Yes, it is a table in a collection what contains two values, yes and no.
Try
Set(
Business_owner,
Table(
{
Answer: Business_owner_TextInput.Text,
Comment: Business_owner_Comment_TextInput.Text
}
)
);
Set(
Related_Project_Dd,
Table(
{
Answer: Related_Project_Dropdown.Selected,
Comment: Related_Project_Comment_TextInput.Text
}
)
);
ClearCollect(
Detail_Table,
Table(
{ Answers: First(Business_owner).Answer.Value, Comments: First(Business_owner).Comment },
{ Answers: First(Related_Project_Dd).Answer.Value, Comments: First(Related_Project_Dd).Comment }
)
)
If you specified the column name for the collection that is in the Items property of your dropdown, replace "Value" by that (it should suggest it)
Thank you very much for your help.
The solution is similar what you suggested.
ClearCollect(
Detail_Table,
{ Answers: First(Business_owner).Answer, Comments: First(Business_owner).Comment },
{ Answers: First(Related_Project_Dd).Answer.SourceTableOfTheDropdown, Comments: First(Related_Project_Dd).Comment}
)
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
184 | |
53 | |
41 | |
36 | |
30 |
User | Count |
---|---|
240 | |
74 | |
71 | |
69 | |
65 |