# How to Customize Interactive App Card

**URL:** <https://discourse.openondemand.org/t/how-to-customize-interactive-app-card/1306>\
**Category:** Get Help\
**Tags:** question\
**Created:** [February 5, 2021, 3:51am UTC](https://discourse.openondemand.org/t/how-to-customize-interactive-app-card/1306 "2021-02-05T03:51:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![daroachgb](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/daroachgb/32/601_2.png) [@daroachgb](https://discourse.openondemand.org/u/daroachgb)\
**Post date:** [February 5, 2021, 3:51am UTC](https://discourse.openondemand.org/t/how-to-customize-interactive-app-card/1306/1 "2021-02-05T03:51:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![omerzulfiqar](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/omerzulfiqar/32/621_2.png) [@omerzulfiqar](https://discourse.openondemand.org/u/omerzulfiqar)\
**Post date:** [February 5, 2021, 7:04am UTC](https://discourse.openondemand.org/t/how-to-customize-interactive-app-card/1306/2 "2021-02-05T07:04:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [February 5, 2021, 6:01pm UTC](https://discourse.openondemand.org/t/how-to-customize-interactive-app-card/1306/3 "2021-02-05T18:01:00Z")

</div>

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 `!`.

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

````

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [February 5, 2021, 6:02pm UTC](https://discourse.openondemand.org/t/how-to-customize-interactive-app-card/1306/4 "2021-02-05T18:02:23Z")

</div>

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

> <https://github.com/OSC/ondemand/issues/878>
>
> Right now, info.{html,md}.erb is rendered with the BatchConnect::Session's context. But it may be more appropriate to use BatchConnect::SessionContext and/or both?
> From a...

---

<div class="post-metadata">

**Author:** ![daroachgb](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/daroachgb/32/601_2.png) [@daroachgb](https://discourse.openondemand.org/u/daroachgb)\
**Post date:** [February 5, 2021, 7:08pm UTC](https://discourse.openondemand.org/t/how-to-customize-interactive-app-card/1306/5 "2021-02-05T19:08:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![daroachgb](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/daroachgb/32/601_2.png) [@daroachgb](https://discourse.openondemand.org/u/daroachgb)\
**Post date:** [February 5, 2021, 7:12pm UTC](https://discourse.openondemand.org/t/how-to-customize-interactive-app-card/1306/6 "2021-02-05T19:12:42Z")

</div>

````auto
```
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 

````

---

<div class="post-metadata">

**Author:** ![daroachgb](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/daroachgb/32/601_2.png) [@daroachgb](https://discourse.openondemand.org/u/daroachgb)\
**Post date:** [February 5, 2021, 7:16pm UTC](https://discourse.openondemand.org/t/how-to-customize-interactive-app-card/1306/7 "2021-02-05T19:16:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![efranz](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/efranz/32/27_2.png) [@efranz](https://discourse.openondemand.org/u/efranz)\
**Post date:** [February 5, 2021, 8:00pm UTC](https://discourse.openondemand.org/t/how-to-customize-interactive-app-card/1306/8 "2021-02-05T20:00:46Z")

</div>

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:

```auto
`user_defined_context_file.read`:

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

```

And this was the result:

 ![screen 2021-02-05 at 2.57.54 PM](https://us1.discourse-cdn.com/flex015/uploads/osc/original/1X/e02db5bdbf7e95c37957be7023798c021bd9b3ae.png)

---

<div class="post-metadata">

**Author:** ![daroachgb](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/daroachgb/32/601_2.png) [@daroachgb](https://discourse.openondemand.org/u/daroachgb)\
**Post date:** [February 7, 2021, 9:01pm UTC](https://discourse.openondemand.org/t/how-to-customize-interactive-app-card/1306/9 "2021-02-07T21:01:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![westburg.2](https://avatars.discourse-cdn.com/v4/letter/w/0ea827/32.png) [@westburg.2](https://discourse.openondemand.org/u/westburg.2)\
**Post date:** [May 26, 2022, 3:43pm UTC](https://discourse.openondemand.org/t/how-to-customize-interactive-app-card/1306/10 "2022-05-26T15:43:00Z")

</div>


