result = [] try: async with get_sor_context(request._run_ns, 'uapi') as sor: user_orgid = await get_userorgid() apps = await sor.sqlExe( "select id, name from upapp order by name", {} ) if apps: for r in apps: result.append({'value': str(r.id), 'text': r.name or ''}) except Exception as e: debug(f'get_upapps error: {e}') return json.dumps(result, ensure_ascii=False)