# Return from app

**URL:** <https://forum.inductiveautomation.com/t/return-from-app/10117>\
**Category:** Ignition\
**Created:** [June 10, 2015, 9:50pm UTC](https://forum.inductiveautomation.com/t/return-from-app/10117 "2015-06-10T21:50:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcs226](https://avatars.discourse-cdn.com/v4/letter/l/848f3c/32.png) [@lcs226](https://forum.inductiveautomation.com/u/lcs226)\
**Post date:** [June 10, 2015, 9:50pm UTC](https://forum.inductiveautomation.com/t/return-from-app/10117/1 "2015-06-10T21:50:17Z")

</div>

I have an operator input a number and then press “Save Button” to run the following:

[color=#0000FF]lotNum = event.source.parent.getComponent(‘tf\_lotNumber’).text  
ingName = system.tag.getTagValue("[Client]Tracking/Selected\_Ing")  
millName = system.tag.getTagValue("[Client]Tracking/Selected\_Mill")  
box = system.tag.getTagValue("[Client]Tracking/Select\_Box\_Count")  
termFloor = system.tag.getTagValue("[Client]Tracking/Floor")  
routine = 1  
feeder1 = “”  
feeder2 = “”

app.ingCode.buffer(lotNum)  
app.Validate\_Lot\_Number.valid(ingCode, ingName, box, routine, millName, termFloor, feeder1, 0) # call validation app.

system.nav.closeWindow(“PopUp\_Box\_Count”)[/color]

#\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

Application script module routine called by above code:

[color=#0000FF]def buffer(ingCode):

```
import app

length = len(ingCode)
bufferCount = 6 - length
if length < 6:
	for x in range(bufferCount):
		ingCode = '0' + ingCode
	
return ingCode[/color]

```

Is there a way to get this app to return the value of ingCode to the function that called it? The way I have tried it does not work.

---

<div class="post-metadata">

**Author:** ![dave.fogle](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@dave.fogle](https://forum.inductiveautomation.com/u/dave.fogle)\
**Post date:** [June 10, 2015, 10:27pm UTC](https://forum.inductiveautomation.com/t/return-from-app/10117/2 "2015-06-10T22:27:49Z")

</div>

It should return a value as you've written it. Make sure you're assigning the return value to something. I assume you want it assigned to ingCode since you use that in the next function call.

`
ingCode = app.ingCode.buffer(lotNum) `

---

<div class="post-metadata">

**Author:** ![JGJohnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgjohnson/32/29582_2.png) [@JGJohnson](https://forum.inductiveautomation.com/u/JGJohnson)\
**Post date:** [June 10, 2015, 10:28pm UTC](https://forum.inductiveautomation.com/t/return-from-app/10117/3 "2015-06-10T22:28:33Z")

</div>

Yes.

```auto
ingCode = app.ingCode.buffer(lotNum) 
```
