cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Aydeedglz
Helper I
Helper I

Gallery Display Format

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:

Aydeedglz_0-1660845984678.png

[{"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 

Aydeedglz_1-1660846044011.png

 

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:

Aydeedglz_2-1660846210206.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Aydeedglz
Helper I
Helper I

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:

 

Aydeedglz_0-1660932719663.png

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@Aydeedglz 

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
Aydeedglz
Helper I
Helper I

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')

)

Aydeedglz
Helper I
Helper I

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:

 

Aydeedglz_0-1660932719663.png

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,592)