Hi,
I am making an app with the JSON format, and I inserted a gallery to see my results. The problem is the way it is displayed, is it a way to Display the data in a friendly or professional way? Seeing maybe the title of the report and name... and once clicking on it, we can see more detail. Here I am attaching the examples.
Thanks! If someone knows please help meeee!!
Gallery:
[{"Choices":"NA","ColumnType":{"Value":"Text"},"Data":"","Required":true,"Title":"Requester Name"},{"Choices":"NA","ColumnType":{"Value":"Text"},"Data":"","Required":true,"Title":"Department "},{"Choices":"NA","ColumnType":{"Value":"Text"},"Data":"","Required":true,"Title":"Supervisor "},{"Choices":"NA","ColumnType":{"Value":"Text"},"Data":"","Required":true,"Title":"Email"},{"Choices":"NA","ColumnType":{"Value":"Text"},"Data":"","Required":true,"Title":"Report Description"},{"Choices":"EMEA;APAC;NAFTA;LATAM","ColumnType":{"Value":"Choice"},"Data":null,"Required":true,"Title":"Region"},{"Choices":"NA","ColumnType":{"Value":"Text"},"Data":"","Required":true,"Title":"Data Source"},{"Choices":"NA","ColumnType":{"Value":"Number"},"Data":"","Required":true,"Title":"Refresh Frequency"},{"Choices":"NA","ColumnType":{"Value":"Text"},"Data":"","Required":true,"Title":"List of Users"},{"Choices":"NA","ColumnType":{"Value":"Text"},"Data":"","Required":true,"Title":"List of Fields "},{"Choices":"NA","ColumnType":{"Value":"Text"},"Data":"","Required":true,"Title":"Measures and filters"},{"Choices":"NA","ColumnType":{"Value":"Date"},"Data":"8/17/2022","Required":true,"Title":"Date of release "},{"Choices":"NA","ColumnType":{"Value":"Text"},"Data":"","Required":false,"Title":"Examples or attachments "}]
Where the data if uploaded
Jason Code:
ClearCollect(colSubmit,colFormatTemplate);
ClearCollect(colGalData,Gallery2.AllItems);
ForAll(
colGalData,
UpdateIf(
colSubmit,
Title = colGalData[@Title],
{
Data: Switch(
ThisRecord.ColumnType.Value,
"Text",TextBox.Text,
"Number",NumberInput.Text,
"Yes/No",Toggle1.Value,
"Date",DatePicker1.SelectedDate,
"Choice",Dropdown1.Selected.Result
)
}
)
);
Patch('Report Request App - Form Results_1',Defaults('Report Request App - Form Results_1'),{Title:User().FullName,Result:JSON(colSubmit,JSONFormat.Compact)});
Navigate('Initial Screen')
Share Point:
Solved! Go to Solution.
I have already found the solution to this, I erased the text format in the gallery and inserted a HTMLTEXT instead, then I used this code, inside HtmlText:
You can convert a table/record to JSON in PowerApps, but you cannot use a function to convert it from JSON back to a record. For that, you will need to parse the text and build your own record/table from it.
I hope this is helpful for you.
Hi,
Using a the match function and writting the format of the JSON in the share point is possible to bring the information, but there is a problem in my code, Power Apps is not telling me where, but I se the warning sign in my button. The port in bold is the one that is not working, and I can't figure why...
ClearCollect(colSubmit,colFormatTemplate);
ClearCollect(colGalData,galForm.AllItems);
ForAll(
colGalData,
UpdateIf(
colSubmit,
Title = colGalData[@Title],
{
Data: Switch(
ThisRecord.ColumnType.Value,
"Text",TextBox.Text,
"Number",NumberInput.Text,
"Yes/No",Toggle1.Value,
"Date",DatePicker1.SelectedDate,
"Choice",Dropdown1.Selected.Result
)
}
)
);
If(
!IsBlank(LookUp(colSubmit,Required = "Yes" && IsBlank(Data))),
Notify("Fill required fields",NotificationType.Error,3000),
Patch('Report Request App - Form Results_1',varItem,
{
Title: LookUp(colSubmit,Title = "Requester Name").Data,
Result: JSON(colSubmit,Compact),
Email: Value(LookUp(colSubmit,Title = "Email").Data),
Supervisor: LookUp(colSubmit,Title = "Supervisor").Data,
Region: LookUp(colSubmit,Title = "Region").Data
}
);
Notify(
"Form Successfully Submitted",
NotificationType.Success,
3000
);
Navigate('Home Screen')
)
I have already found the solution to this, I erased the text format in the gallery and inserted a HTMLTEXT instead, then I used this code, inside HtmlText:
User | Count |
---|---|
252 | |
106 | |
95 | |
50 | |
39 |