Can anyone help me understand how to create dynamic text?

HalD
HalD Member

Sorry I am newer to domo and can't figure this out.

Objective: I want an informational block that pulls specific values from a record based on the chosen filter. So a campaign ID or name is chosen and based on that the values in specific columns are shown (status, date, etc)

For example (and the text in [parenthesis] are meant to be dynamic):

[Campaign name] is [description] and starts on [start date]. Current status is [status].

I have tried to accomplish this using smart text but that seems to only pull limited information such as info about the dataset, filter, etc and not specific data out of the dataset itself. If this would work let me know. I also tried using dynamic textbox (such as https://domohelp.domo.com/hc/en-us/articles/360042924514-Dynamic-Textbox) But do not seem to be able to do much other than get an aggregate of one value such as campaign name description is "0" where 0 is the count of descriptions.

So how can I get something like this to work? I am open to different approaches but I am not getting it to work.

Answers

  • You can utilize a notebook card on a page and insert dynamic text directly into the notebook using a several summary numbers. When editing the notebook card you can click on the [#] button in the toolbar to insert a summary number. Since it is a summary number you'll likely need to use a min or max on your string fields but should work assuming you have a single value in your filtered dataset.

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • HalD
    HalD Member

    @GrantSmith The issue is I am not wanting a "summary" or any aggregate of fields. I want 1:1 value. If I filter to an ID it is a single record and I want the ACTUAL data in a field. I don't want to summarize multiple "descriptions" but pull the description related to that record.

    Like the example: [Campaign name] is [description] and starts on [start date]. Current status is [status]. Where the filter chooses the campaign name an actual value for that record would pull the description, status, and start date.

  • @HalD

    Is your filtered data returning a single record or are the campaign name, description, start date and status all the same value after filtering? If that's the case taking the MAX of those values will give you the same single value allowing you to display it correctly on your page.

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • HalD
    HalD Member

    Sorry, which version/option are you asking about. Smart text, dynamic text box, or other? I don't see how to apply that to the dynamic, nor do I see a way to do this with Smart text and/or the summary previously described.

  • I think an easier option would be for you to utilize a beast mode and put that into a text card to display with a message telling the user to select a single campaign if they have more:

    Beast Mode:

    CASE WHEN SUM(1) > 1 THEN
    'Please select a single campaign'
    ELSE
    MAX(CONCAT(`Campaign name`,' is ',`description`,' and starts on ', `start date`, '. Current status is ', `status`))
    END
    

    You can then put that beast mode into the text card for the TEXT value. When the user filters the page down to a single campaign it should display the text you're looking for in the text card.


    CONCAT is joining the value in the columns (back-ticked `) with string (single quote ') to combine into a single text value for your card.

    MAX is selecting the maximum string value (in our case it's a single value because the first part of the case statement is checking to see if there's more than one row - this will return just the single row value)

    **Was this post helpful? Click Agree or Like below**
    **Did this solve your problem? Accept it as a solution!**
  • HalD
    HalD Member

    Thank you. I'll take a look at this.