Trying to use Data Fabric object to dynamically generate label in Apps

Hi there, I’m currently working on an app that is supposed to dynamically pull the label for a text field from the Data Fabric. The problem is, when I try to do that, the label always remains empty. I’ve managed to circumvent the problem by adding a table to the page, using the specific data as a source for that table, hiding the table, and then referencing it from the label. That way, it works, but I’m certain it should also work directly, shouldn’t it?

For reference, here’s how the data is collected for the table:

Fetch(of WitsWagersQuestions)(Nothing, Nothing, Nothing, Nothing, New ExpansionFieldOption(){addExpansionFieldOption("CreatedBy", New String(){"Id","Name"}), addExpansionFieldOption("UpdatedBy", New String(){"Id","Name"})})

And then I get it to the label this way:

EnterAnswerPage.Table.DataSource.data(0).Question

But this is what I tried and which leaves the label empty:

Fetch(of WitsWagersQuestions)(Nothing, Nothing, Nothing, Nothing, New ExpansionFieldOption(){addExpansionFieldOption("CreatedBy", New String(){"Id","Name"}), addExpansionFieldOption("UpdatedBy", New String(){"Id","Name"})}).data(0).Question

@christian.nonnenbroich

welcome to the community

can you try like this

cheers

That worked, thank you very much! It’s strange, because it doesn’t look like much of a difference. I assume it’s a parse-by-value/parse-by-reference-thing, so that if I try to put the value directly into the label, it’s just not there when the value is set, and then the label doesn’t “check back”, while this way, it is only put into the label after everything was evaluated?

@christian.nonnenbroich

fetch is async function so the retreiival might be delayed..so that might be causing the issue

cheers

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.