How to Customize Interactive App Card

Hello

I would like to customize the interactive app card title with one of the form attributes selected by the user.

For example, if the users selects Option A or Option B, I would like Option A or Option B text in the interactive app card title.

I am not sure exactly where the user defined variables are sent to from submit.yml.erb. But I think if you pass it to the script there and define in it in the HTML file that controls the display of the card you will able to customize it

1 Like

We don’t currently have this ability. You may be able to infer the choice through what’s returned in the scheduler (if it’s like a queue or something the scheduler would know about).

Drop this file info.md.erb in the root of your project in a dev environment (not production! don’t let your users see this garbage output while you inspect what’s available).

Note that the exclamation points I added here ! you should remove. I’m trying to show 3 backticks for markdown in what is itself markdown and I can’t quite figure out how to escape it.

So drop this file, and remove the unnecessary !.

### inspected info
```!
<%= self.inspect %>
```!
1 Like

Also! I added this ticket to our source repo to add this functionality.

Thank you Jeff.

Yes I have been looking to edit view.html.erb but I don’t have access to my context vars. I traced why port and host show up, and it comes from the export host and export port lines in job_script_contents. I don’t know how to edit this file to add a special import for my one job, or if that is the right move.

I will be exploring self.inspect now.

```
test
```
Curious question, escaping backticks. You can by using more than three ticks when defining your markdown code block. 

https://meta.stackexchange.com/a/82722 

The self.inspect object did not have the relevant info I needed unfortunately. Unless I set the job name in the launch script? :thinking:

When we stage the job, we write the “SessionContext” - this is essentially an object form of the form submission, to a file called user_defined_context.json and the Pathname object to this file is accessible from the Session object via user_defined_context_file. So can read this file since the Session object is the context of the info.html.erb / info.md.erb.

For example, I did this at the bottom of info.md.erb for a MATLAB app:

`user_defined_context_file.read`:

<pre><%= user_defined_context_file.read %></pre>

And this was the result:

1 Like

Thank you, this was key to me solving the issue. I just tested and can confirm sucess.